import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "about" */ '../views/login/index.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import(/* webpackChunkName: "about" */ '../views/login/register.vue')
  },
  {
    path: '/adminBooksList',
    name: 'adminBooksList',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/adminBooks/List.vue')
  },
  {
    path: '/booklist',
    name: 'booklist',
    component: () => import(/* webpackChunkName: "about" */ '../views/user/booklist.vue')
  },
  {
    path: '/bookinfo',
    name: 'bookinfo',
    component: () => import(/* webpackChunkName: "about" */ '../views/user/bookInfo.vue')
  },
  {
    // 借阅
    path: '/bookborrowtime',
    name: 'bookBorrowTime',
    component: () => import(/* webpackChunkName: "about" */ '../views/user/bookBorrowTime.vue')
  },
  {
    path: '/userinfo',
    name: 'userInfo',
    component: () => import(/* webpackChunkName: "about" */ '../views/common/userInfo.vue')
  },
  {
    // 预约信息
    path: '/preorder',
    name: 'preOrder',
    component: () => import(/* webpackChunkName: "about" */ '../views/user/preOrder.vue')
  },
  {
    path: '/feedback',
    name: 'feedBack',
    component: () => import(/* webpackChunkName: "about" */ '../views/user/feedBack.vue')
  },
  {
    path: '/preorderinfo',
    name: 'preorderInfo',
    component: () => import(/* webpackChunkName: "about" */ '../views/adminView/preorderInfo.vue')
  },
  {
    path: '/',
    name: 'adminfeedBack',
    component: () => import(/* webpackChunkName: "about" */ '../views/adminView/adminfeedBack.vue')
  },
  // 书籍增加-管理员
  {
    path: '/adminBookAdd',
    name: 'adminBookAdd',
    component: () => import(/* webpackChunkName: "about" */ '../views/adminView/adminBookAdd.vue')
  },
  // 用户列表-管理员
  {
    path: '/adminUserList',
    name: 'adminUserList',
    component: () => import(/* webpackChunkName: "about" */ '../views/adminView/adminUserList.vue')
  },
  // 管理员增加-管理员
  {
    path: '/adminUserAdd',
    name: 'adminUserAdd',
    component: () => import(/* webpackChunkName: "about" */ '../views/adminView/adminUserAdd.vue')
  },
  // 管理员详情-管理员
  {
    path: '/adminUserEdit',
    name: 'adminUserEdit',
    component: () => import(/* webpackChunkName: "about" */ '../views/adminView/adminUserEdit.vue')
  },
  // 对比页面-管理员
  {
    path: '/adminCompare',
    name: 'adminCompare',
    component: () => import(/* webpackChunkName: "about" */ '../views/adminView/adminCompare.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
